package com.lichongbing.lyoggl.mapper;

import com.lichongbing.lyoggl.model.Bank;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Entity com.lichongbing.lyoggl.model.Bank
 */
@Component
public interface BankMapper extends BaseMapper<Bank> {
    /**
     * 查询该用户下所有信用卡
     * @param userid
     * @return
     */
    @Select("select * from bank where uid = #{userid}")
    List<Bank> findByUid(String userid);

    /**
     * 删除信用卡
     * @param id
     * @param userid
     * @return
     */
    @Delete("delete from bank where id = #{id} and uid = #{userid}")
    int deleteByUid(String id, String userid);
}




